<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="类别" prop="lb">
        <el-input
          v-model="queryParams.lb"
          placeholder="请输入类别"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="类别" prop="nd">
        <el-input
          v-model="queryParams.nd"
          placeholder="请输入类别"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="年度" prop="nj">
        <el-input
          v-model="queryParams.nj"
          placeholder="请输入年度"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="xm">
        <el-input
          v-model="queryParams.xm"
          placeholder="请输入姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="xb">
        <el-input
          v-model="queryParams.xb"
          placeholder="请输入姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="sfzh">
        <el-input
          v-model="queryParams.sfzh"
          placeholder="请输入姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="xh">
        <el-input
          v-model="queryParams.xh"
          placeholder="请输入姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="rxsj">
        <el-input
          v-model="queryParams.rxsj"
          placeholder="请输入姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="rxqxx">
        <el-input
          v-model="queryParams.rxqxx"
          placeholder="请输入姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="xy">
        <el-input
          v-model="queryParams.xy"
          placeholder="请输入姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="zy">
        <el-input
          v-model="queryParams.zy"
          placeholder="请输入姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="xz">
        <el-input
          v-model="queryParams.xz"
          placeholder="请输入姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="学习形式" prop="xxxs">
        <el-input
          v-model="queryParams.xxxs"
          placeholder="请输入学习形式"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="学习形式" prop="bysj">
        <el-input
          v-model="queryParams.bysj"
          placeholder="请输入学习形式"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="学习形式" prop="byjl">
        <el-input
          v-model="queryParams.byjl"
          placeholder="请输入学习形式"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="毕业证书编号" prop="byzh">
        <el-input
          v-model="queryParams.byzh"
          placeholder="请输入毕业证书编号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="学位证编号" prop="xwzh">
        <el-input
          v-model="queryParams.xwzh"
          placeholder="请输入学位证编号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="hfby">
        <el-input
          v-model="queryParams.hfby"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="zslx">
        <el-input
          v-model="queryParams.zslx"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="jg">
        <el-input
          v-model="queryParams.jg"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="dz">
        <el-input
          v-model="queryParams.dz"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="dh">
        <el-input
          v-model="queryParams.dh"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="sPage">
        <el-input
          v-model="queryParams.sPage"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="ePage">
        <el-input
          v-model="queryParams.ePage"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="bz">
        <el-input
          v-model="queryParams.bz"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="dataRecruitsflag">
        <el-input
          v-model="queryParams.dataRecruitsflag"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="dataScoreinfoflag">
        <el-input
          v-model="queryParams.dataScoreinfoflag"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="dataEmploymentinfoflag">
        <el-input
          v-model="queryParams.dataEmploymentinfoflag"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="email">
        <el-input
          v-model="queryParams.email"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="qq">
        <el-input
          v-model="queryParams.qq"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="tel">
        <el-input
          v-model="queryParams.tel"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="ksh">
        <el-input
          v-model="queryParams.ksh"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="mz">
        <el-input
          v-model="queryParams.mz"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="lbcode">
        <el-input
          v-model="queryParams.lbcode"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="缓发毕业" prop="lbname">
        <el-input
          v-model="queryParams.lbname"
          placeholder="请输入缓发毕业"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:certificatesi:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:certificatesi:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:certificatesi:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:certificatesi:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="certificatesiList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="缓发毕业" align="center" prop="recno" />
      <el-table-column label="类别" align="center" prop="lb" />
      <el-table-column label="类别" align="center" prop="nd" />
      <el-table-column label="年度" align="center" prop="nj" />
      <el-table-column label="姓名" align="center" prop="xm" />
      <el-table-column label="姓名" align="center" prop="xb" />
      <el-table-column label="姓名" align="center" prop="sfzh" />
      <el-table-column label="姓名" align="center" prop="xh" />
      <el-table-column label="姓名" align="center" prop="rxsj" />
      <el-table-column label="姓名" align="center" prop="rxqxx" />
      <el-table-column label="姓名" align="center" prop="xy" />
      <el-table-column label="姓名" align="center" prop="zy" />
      <el-table-column label="姓名" align="center" prop="xz" />
      <el-table-column label="学习形式" align="center" prop="xxxs" />
      <el-table-column label="学习形式" align="center" prop="bysj" />
      <el-table-column label="学习形式" align="center" prop="byjl" />
      <el-table-column label="毕业证书编号" align="center" prop="byzh" />
      <el-table-column label="学位证编号" align="center" prop="xwzh" />
      <el-table-column label="缓发毕业" align="center" prop="hfby" />
      <el-table-column label="缓发毕业" align="center" prop="zslx" />
      <el-table-column label="缓发毕业" align="center" prop="jg" />
      <el-table-column label="缓发毕业" align="center" prop="dz" />
      <el-table-column label="缓发毕业" align="center" prop="dh" />
      <el-table-column label="缓发毕业" align="center" prop="sPage" />
      <el-table-column label="缓发毕业" align="center" prop="ePage" />
      <el-table-column label="缓发毕业" align="center" prop="bz" />
      <el-table-column label="缓发毕业" align="center" prop="dataRecruitsflag" />
      <el-table-column label="缓发毕业" align="center" prop="dataScoreinfoflag" />
      <el-table-column label="缓发毕业" align="center" prop="dataEmploymentinfoflag" />
      <el-table-column label="缓发毕业" align="center" prop="email" />
      <el-table-column label="缓发毕业" align="center" prop="qq" />
      <el-table-column label="缓发毕业" align="center" prop="tel" />
      <el-table-column label="缓发毕业" align="center" prop="ksh" />
      <el-table-column label="缓发毕业" align="center" prop="mz" />
      <el-table-column label="缓发毕业" align="center" prop="lbcode" />
      <el-table-column label="缓发毕业" align="center" prop="lbname" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:certificatesi:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:certificatesi:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改【请填写功能名称】对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="类别" prop="lb">
          <el-input v-model="form.lb" placeholder="请输入类别" />
        </el-form-item>
        <el-form-item label="类别" prop="nd">
          <el-input v-model="form.nd" placeholder="请输入类别" />
        </el-form-item>
        <el-form-item label="年度" prop="nj">
          <el-input v-model="form.nj" placeholder="请输入年度" />
        </el-form-item>
        <el-form-item label="姓名" prop="xm">
          <el-input v-model="form.xm" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="姓名" prop="xb">
          <el-input v-model="form.xb" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="姓名" prop="sfzh">
          <el-input v-model="form.sfzh" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="姓名" prop="xh">
          <el-input v-model="form.xh" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="姓名" prop="rxsj">
          <el-input v-model="form.rxsj" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="姓名" prop="rxqxx">
          <el-input v-model="form.rxqxx" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="姓名" prop="xy">
          <el-input v-model="form.xy" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="姓名" prop="zy">
          <el-input v-model="form.zy" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="姓名" prop="xz">
          <el-input v-model="form.xz" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="学习形式" prop="xxxs">
          <el-input v-model="form.xxxs" placeholder="请输入学习形式" />
        </el-form-item>
        <el-form-item label="学习形式" prop="bysj">
          <el-input v-model="form.bysj" placeholder="请输入学习形式" />
        </el-form-item>
        <el-form-item label="学习形式" prop="byjl">
          <el-input v-model="form.byjl" placeholder="请输入学习形式" />
        </el-form-item>
        <el-form-item label="毕业证书编号" prop="byzh">
          <el-input v-model="form.byzh" placeholder="请输入毕业证书编号" />
        </el-form-item>
        <el-form-item label="学位证编号" prop="xwzh">
          <el-input v-model="form.xwzh" placeholder="请输入学位证编号" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="hfby">
          <el-input v-model="form.hfby" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="zslx">
          <el-input v-model="form.zslx" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="jg">
          <el-input v-model="form.jg" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="dz">
          <el-input v-model="form.dz" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="dh">
          <el-input v-model="form.dh" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="sPage">
          <el-input v-model="form.sPage" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="ePage">
          <el-input v-model="form.ePage" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="bz">
          <el-input v-model="form.bz" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="dataRecruitsflag">
          <el-input v-model="form.dataRecruitsflag" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="dataScoreinfoflag">
          <el-input v-model="form.dataScoreinfoflag" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="dataEmploymentinfoflag">
          <el-input v-model="form.dataEmploymentinfoflag" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="email">
          <el-input v-model="form.email" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="qq">
          <el-input v-model="form.qq" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="tel">
          <el-input v-model="form.tel" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="ksh">
          <el-input v-model="form.ksh" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="mz">
          <el-input v-model="form.mz" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="lbcode">
          <el-input v-model="form.lbcode" placeholder="请输入缓发毕业" />
        </el-form-item>
        <el-form-item label="缓发毕业" prop="lbname">
          <el-input v-model="form.lbname" placeholder="请输入缓发毕业" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listCertificatesi, getCertificatesi, delCertificatesi, addCertificatesi, updateCertificatesi, exportCertificatesi } from "@/api/system/certificatesi";

export default {
  name: "Certificatesi",
  components: {
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 【请填写功能名称】表格数据
      certificatesiList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        lb: null,
        nd: null,
        nj: null,
        xm: null,
        xb: null,
        sfzh: null,
        xh: null,
        rxsj: null,
        rxqxx: null,
        xy: null,
        zy: null,
        xz: null,
        xxxs: null,
        bysj: null,
        byjl: null,
        byzh: null,
        xwzh: null,
        hfby: null,
        zslx: null,
        jg: null,
        dz: null,
        dh: null,
        sPage: null,
        ePage: null,
        bz: null,
        dataRecruitsflag: null,
        dataScoreinfoflag: null,
        dataEmploymentinfoflag: null,
        email: null,
        qq: null,
        tel: null,
        ksh: null,
        mz: null,
        lbcode: null,
        lbname: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询【请填写功能名称】列表 */
    getList() {
      this.loading = true;
      listCertificatesi(this.queryParams).then(response => {
        this.certificatesiList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        recno: null,
        lb: null,
        nd: null,
        nj: null,
        xm: null,
        xb: null,
        sfzh: null,
        xh: null,
        rxsj: null,
        rxqxx: null,
        xy: null,
        zy: null,
        xz: null,
        xxxs: null,
        bysj: null,
        byjl: null,
        byzh: null,
        xwzh: null,
        hfby: null,
        zslx: null,
        jg: null,
        dz: null,
        dh: null,
        sPage: null,
        ePage: null,
        bz: null,
        dataRecruitsflag: null,
        dataScoreinfoflag: null,
        dataEmploymentinfoflag: null,
        email: null,
        qq: null,
        tel: null,
        ksh: null,
        mz: null,
        lbcode: null,
        lbname: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.recno)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加【请填写功能名称】";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const recno = row.recno || this.ids
      getCertificatesi(recno).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改【请填写功能名称】";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.recno != null) {
            updateCertificatesi(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addCertificatesi(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const recnos = row.recno || this.ids;
      this.$confirm('是否确认删除【请填写功能名称】编号为"' + recnos + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delCertificatesi(recnos);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有【请填写功能名称】数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return exportCertificatesi(queryParams);
        }).then(response => {
          this.download(response.msg);
        })
    }
  }
};
</script>
